package com.example.day11_7_11_2.model;


import com.example.day11_7_11_2.ResultSubscriber;
import com.example.day11_7_11_2.base.BaseModel;
import com.example.day11_7_11_2.bean.NaviBean;
import com.example.day11_7_11_2.presenter.CallBack;
import com.example.day11_7_11_2.util.HttpUtil;
import com.example.day11_7_11_2.util.RxUtils;

public class MModel extends BaseModel {
    public void getData(final CallBack<NaviBean> callBack) {

        addDisposable(HttpUtil.getInstance()
                .getWanService()
                .getNavi()
                .compose(RxUtils.<NaviBean>rxSchedulerHelper())
                .subscribeWith(new ResultSubscriber<NaviBean>() {
                    @Override
                    public void onNext(NaviBean naviBean) {
                        callBack.succeed(naviBean);
                    }
                }));
    }
}
